<?php 
	$tr = Application_Form_FrmLanguages::getCurrentlanguage(); 
	$session_user=new Zend_Session_Namespace('auth');
	$request=Zend_Controller_Front::getInstance()->getRequest();
	$user_info = new Application_Model_DbTable_DbGetUserInfo();
	$result = $user_info->getUserInfo();
	//module user
	$url_user_list = array($this->url(array('module'=>'userWu','controller'=>'user','action'=>'index')), "MENU_RSVACL_USER_INDEX",null);
	$url_user_add = array($this->url(array('module'=>'userWu','controller'=>'user','action'=>'add-user')), "MENU_RSVACL_USER_ADD_USER",null);
	$url_add_user_access = array($this->url(array('module'=>'userWu','controller'=>'user-access','action'=>'index')), "MENU_RSVACL_USER_ACCESS_ADD",null);
	$url_user_acl_list = array($this->url(array('module'=>'userWu','controller'=>'acl','action'=>'index')), "MENU_RSVACL_USER_ACL_LIST",null);
	$url_user_type = array($this->url(array('module'=>'userWu','controller'=>'user-type','action'=>'index')), "MENU_RSVACL_USER_TYPE_LIST",null);
	
	//module Faculty
	$url_faculty = $this->url(array('module'=>'faculty','controller'=>'index','action'=>'index',null));
	$url_faculty_list = $this->url(array('module'=>'faculty','controller'=>'index','action'=>'list',null));
	$url_faculty_add = $this->url(array('module'=>'faculty','controller'=>'index','action'=>'add',null));
	$url_faculty_edit = $this->url(array('module'=>'faculty','controller'=>'index','action'=>'edit',null));
	//module Department
	$url_department = $this->url(array('module'=>'department','controller'=>'index','action'=>'index',null));
	$url_department_list = $this->url(array('module'=>'department','controller'=>'index','action'=>'list',null));
	$url_department_add = $this->url(array('module'=>'department','controller'=>'index','action'=>'add',null));
	$url_department_edit = $this->url(array('module'=>'department','controller'=>'index','action'=>'edit',null));
	//module Subject
	$url_subject = $this->url(array('module'=>'subject','controller'=>'index','action'=>'index',null));
	$url_subject_list = $this->url(array('module'=>'subject','controller'=>'index','action'=>'list',null));
	$url_subject_add = $this->url(array('module'=>'subject','controller'=>'index','action'=>'add',null));
	$url_subject_edit = $this->url(array('module'=>'subject','controller'=>'index','action'=>'edit',null));
	//module room
	$url_room = $this->url(array('module'=>'room','controller'=>'index','action'=>'index',null));
	$url_room_list = $this->url(array('module'=>'room','controller'=>'index','action'=>'list',null));
	$url_room_add = $this->url(array('module'=>'room','controller'=>'index','action'=>'add',null));
	$url_room_edit = $this->url(array('module'=>'room','controller'=>'index','action'=>'edit',null));
?>
<?php if (empty($session_user->user_name)){?>
<?php $db=Application_Model_DbTable_DbUsers::redirectUrl("/index/");
?>
<?php }else{?>

<!DOCTYPE html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <title>Schedule Western</title>

    <!-- Bootstrap core CSS -->
    <link href="<?php echo $this->baseUrl()?>/css/bootstrap.css" rel="stylesheet">
	<link href="<?php echo $this->baseUrl(); ?>/css/font-awesome.min.css" rel="stylesheet">
	<link href="<?php echo $this->baseUrl(); ?>/css/font-awesome.css" rel="stylesheet">
    <!-- Add custom CSS here -->
    <link href="<?php echo $this->baseUrl(); ?>/css/sb-admin.css" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo $this->baseUrl(); ?>/font-awesome/css/font-awesome.min.css">
    <!-- Page Specific CSS -->
    <!-- get for select auto complete chosen.jquery.js-->
		<script type="text/javascript" src="<?php echo $this->baseUrl();?>/test/chosen.jquery.js"></script>
		<link rel="stylesheet" media="screen" href="<?php echo $this->baseUrl();?>/css/chosen.css" type="text/css" />
  </head>
<body>
    <div id="wrapper">
       <!-- Sidebar -->
      <!-- Sidebar -->
      <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a  style="border: 0; " class="navbar-brand" href="<?php echo $this->baseUrl(); ?>/index/dashboad"><img src="<?php echo $this->baseUrl(); ?>/images/logo_download.gif" width="30"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
        </div>
    

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">  
          <ul class="nav navbar-nav navbar-left navbar-user" id="side-menu">
          <?php if($result["level"]==1){ ?>
          	 <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-gear"></i> <?php echo "Faculty at Western"?><b class="caret"></b></a>
              <ul class="dropdown-menu">
              	<li><a href="<?php echo $url_faculty_add?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp; <?php echo "Add Faculty & foundation at Western" ?></a></li>
                <li><a href="<?php echo $url_faculty_list ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo "List Faculty & foundation at Western" ?></a></li>
             </ul>
            </li>
            <?php }?>
            <?php if($result["level"]==1 || $result["level"]==2 || $result["level"]==3 || $result["level"]==4 ){ ?>
          	 <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-gear"></i> <?php echo "Department at Western"?><b class="caret"></b></a>
              <ul class="dropdown-menu">
              <?php if($result["level"]==1 || $result["level"]==2 || $result["level"]==3 ){?>
              	<li><a href="<?php echo $url_department_add ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp; <?php echo "Add Department at Western"?></a></li>
              <?php }?>               
                <li><a href="<?php echo $url_department_list ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo "List Department at Western"?></a></li>
             </ul>
            </li>
            <?php }?>
            <?php if($result["level"]== 1){ ?>
            <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-group"></i>&nbsp;&nbsp;<?php echo "Manage User"?> <b class="caret"></b></a>
              <ul class="dropdown-menu">
              	<?php 
              	if($result["level"]== 8){
              		$url_user_list_foundation = array($this->url(array('module'=>'foundation','controller'=>'user','action'=>'index')), "MENU_RSVACL_USER_INDEX",null);
					$url_user_add_foundation = array($this->url(array('module'=>'foundation','controller'=>'user','action'=>'add-user')), "MENU_RSVACL_USER_ADD_USER",null);
				?>
				<li><a href="<?php echo $url_user_add_foundation[0]; ?>"><i class="icon-user"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_user_add_foundation[1])?></a></li>
                	<li><a href="<?php echo $url_user_list_foundation[0]; ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_user_list[1])?></a></li>            	
              	<?php }?>
              	<?php if($result["level"]== 2 || 3){ ?>
                <li><a href="<?php echo $url_user_add[0]; ?>"><i class="icon-user"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_add_user_access[1])?></a></li>
                <li><a href="<?php echo $url_user_list[0]; ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_user_list[1])?></a></li>               
                <li><a href="<?php echo $url_user_type[0]; ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_user_type[1])?></a></li> 
              	<?php } ?>
                <?php if($result["level"]== 1){ ?>
                <li><a href="<?php echo $url_user_add[0]; ?>"><i class="icon-user"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_add_user_access[1])?></a></li>
                <li><a href="<?php echo $url_user_list[0]; ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_user_list[1])?></a></li>               
                <li><a href="<?php echo $url_add_user_access[0]; ?>"><i class="icon-user"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_add_user_access[1])?></a></li>
                <li><a href="<?php echo $url_user_acl_list[0]; ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_user_acl_list[1])?></a></li>
              	<li><a href="<?php echo $url_user_type[0]; ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp;<?php echo $tr->translate($url_user_type[1])?></a></li> 
              	<?php } ?>           	
              </ul>
            </li>
            <?php }?>
            <?php if($result["level"]){?>
             <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-book"></i><?php echo " Subject" ?> <b class="caret"></b></a>
              <ul class="dropdown-menu">
              <?php if($result["level"]==8){
                $url_subject_lists = $this->url(array('module'=>'foundation','controller'=>'subject','action'=>'list',null));
				$url_subject_adds = $this->url(array('module'=>'foundation','controller'=>'subject','action'=>'add',null));
			 ?>
              	 <li><a href="<?php echo $url_subject_adds; ?>"><i class="icon-book"></i> <?php echo " Add New Subject " ?></a></li>
                 <li><a href="<?php echo $url_subject_lists; ?>"><i class="icon-book"></i><?php echo " List All Subject " ?></a></li>
              <?php }?>
              	<?php if($result["level"]==1||$result["user_id"]==2){?>
                <li><a href="<?php echo $url_subject_add; ?>"><i class="icon-book"></i> <?php echo " Add New Subject " ?></a></li>
                <li><a href="<?php echo $url_subject_list; ?>"><i class="icon-book"></i><?php echo " List All Subject " ?></a></li>
                <?php }?>
              </ul>
            </li>
            <?php }?>
            <?php if($result["level"]){?>
             <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-book"></i><?php echo " Room" ?> <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?php echo $url_room_add; ?>"><i class="icon-book"></i> <?php echo " Add New Room " ?></a></li>
                <li><a href="<?php echo $url_room_list; ?>"><i class="icon-book"></i><?php echo " List All Room " ?></a></li>
              </ul>
            </li>
            <?php }?>
            <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user-md"></i> Lecture Personal Schedule<b class="caret"></b></a>
              <ul class="dropdown-menu">
              	<?php $url_personal_teacher = $this->url(array('module'=>'teacher','controller'=>'index','action'=>'profile',null));;?>
              	<?php $url_personal_teacher_add = $this->url(array('module'=>'teacher','controller'=>'index','action'=>'add-teacher',null));;?>
              	<?php $url_personal_teacher_edit = $this->url(array('module'=>'teacher','controller'=>'index','action'=>'edit-teacher',null));;?>
              	<li><a href="<?php echo $url_personal_teacher_add ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp; Add User Teacher</a></li>
              	<li><a href="<?php echo $url_personal_teacher ?>"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp; Personal Schedule Teacher</a></li>
                <li><a href="<?php echo $this->baseUrl(); ?>/foundation/index/listpersonalschedule"><i class="icon-circle-arrow-right"></i>&nbsp;&nbsp;&nbsp; List All Personal Schedule</a></li>
              </ul>
            </li>
            <li class="dropdown user-dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-calendar"></i> Perpare Schedule <b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?php echo $this->baseUrl(); ?>/foundation/index/schedule"><i class="icon-calendar"></i> &nbsp;&nbsp;Add New Schedule</a></li>
                <li><a href="#"><i class="icon-calendar"></i> &nbsp;&nbsp;View All Schedule Student</a></li>
                <li><a href="#"><i class="icon-calendar"></i> &nbsp;&nbsp;View All Schedule Teacher</a></li>
              </ul>
            </li>
          </ul>
          <ul class="nav navbar-nav navbar-right navbar-user">          	
            <li class="dropdown user-dropdown" >
				<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-user"></i> <?php echo ucwords(strtolower($session_user->fullname));?> <b class="caret"></b></a>
              <ul class="dropdown-menu">
              	<?php 
              	$url_foundation_edit = $this->url(array('module'=>'foundation','controller'=>'user','action'=>'edit-user','id'=>$session_user->user_id,null));
              	$url_profile = $this->url(array('module'=>'foundation','controller'=>'index','action'=>'profile','id'=>$session_user->user_id,null));
              	if($result["level"]==8){ ?>
              		<li><a href="<?php echo $url_profile;?>"><i class="icon-user"></i> Profile </a></li>
              		<li><a href="<?php echo $url_foundation_edit;?>"><i class="icon-user"></i> Settings </a></li>
              		<li class="divider"></li>
                	<li><a href="<?php echo $this->url(array('module'=>'','controller'=>'index','action'=>'logout', 'value'=>1));?>"><i class="icon-power-off"></i> Log Out</a></li>              
              	<?php 
              	}
              	if($result["level"]==1 || $result["user_id"]==2){
              	$url_profiles = $this->url(array('module'=>'userWu','controller'=>'index','action'=>'profile','id'=>$session_user->user_id,null));
              	?>
              	<li><a href="<?php echo $url_profiles;?>"><i class="icon-user"></i> Profile </a></li>
                <li><a href="<?php echo $this->url(array('module'=>'userWu','controller'=>'user','action'=>'view-user', 'id'=>$session_user->user_id));?>"><i class="icon-gear"></i> Settings</a></li>
                <li class="divider"></li>
                <li><a href="<?php echo $this->url(array('module'=>'','controller'=>'index','action'=>'logout', 'value'=>1));?>"><i class="icon-power-off"></i> Log Out</a></li>
              <?php }?>
              </ul>
            </li>
            
          </ul>
        </div><!-- /.navbar-collapse -->
      </nav>
    </div><!-- /#wrapper -->

    <!-- Bootstrap core JavaScript -->
    <script src="<?php echo $this->baseUrl(); ?>/js/jquery.min.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/bootstrap.js"></script>
    <!-- Page Specific Plugins -->
    <script src="<?php echo $this->baseUrl(); ?>/js/raphael-min.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/morris-0.4.3.min.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/morris/chart-data-morris.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/tablesorter/jquery.tablesorter.js"></script>
    <script src="<?php echo $this->baseUrl(); ?>/js/tablesorter/tables.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl()?>/js/jquery-1.7.2.min.js"></script>
<script src="<?php echo $this->baseUrl()?>/js/validation/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<link type="text/css" rel="stylesheet" media="screen" href="<?php echo $this->baseUrl()?>/js/validation/validationEngine.jquery.css">
<script src="<?php echo $this->baseUrl()?>/js/validation/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl()?>/js/jquery-ui-1.8.20.custom.min.js"></script>
<link type="text/css" href="<?php echo $this->baseUrl()?>/css/custom-theme/jquery-ui-1.8.20.custom.css" rel="stylesheet" />	
<script type="text/javascript">
$(function(){				
	$("#frm").validationEngine();
});
</script>
	
<div class="header">
		<div class="cover-top">
		   <div class="sub-header">
	    </div>
</div><!--end of header-->
</body>
</html>
<?php }?>